package com.roamer.audition.server.repository.base;

import com.roamer.audition.server.entity.base.LogicDeleteBaseEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;

/**
 * 逻辑删除 基础存储库
 *
 * @author roamer
 * @version V1.0
 * @date 2019-07-16 11:17
 */
@NoRepositoryBean
public interface LogicDeleteRepository<T extends LogicDeleteBaseEntity, ID extends Serializable>
        extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {

    /**
     * 逻辑删除
     *
     * @param entity 托管实体
     */
    void logicDelete(T entity);

    /**
     * 逻辑删除
     *
     * @param entities 托管实体
     */
    void logicDeleteAll(Iterable<? extends T> entities);
}
